<%@page import="study.itwill.team5.admin.AdminItem"%>
<%@page import="study.itwill.jsp.WebHandler"%>
<%@page import="study.itwill.team5.house.HouseCity"%>
<%@page import="study.itwill.common.PatternChecker"%>
<%@page import="study.itwill.common.DBHandler"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ include file="../session.jsp"%>
<%@ include file="../dbcon.jsp"%>
<%
	PatternChecker checker = PatternChecker.getInstance();
	
	int seq = web.getInt("seq");
	String city_name = web.getValue("city_name");

	if (seq == -1) {
		db.disconnect();
		web.goPage(null, "파라미터가 잘못되었습니다.");
		return;
	}
	
	if (!checker.isValue(city_name)) {
		db.disconnect();
		web.goPage(null, "파라미터가 잘못되었습니다.");
		return;
	}
%>
<%
	/** 데이터 저장 */
	HouseCity city = new HouseCity();
	boolean result = city.editCity(seq, city_name);
	
	/** 접속 해제 */
	db.disconnect();
	
	// 페이지 강제 이동 (JSP)
	web.goPage("viewHouseCity.jsp?seq=" + seq, null);
%>